home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_riv_cndlgreen.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  155 lines

  1. # Jones 3D Cog Script
  2. #
  3. # RIV_CndlGreen.cog
  4. #
  5. # [TRM]
  6. #
  7. # cndld = 91
  8. #
  9. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.  
  14.     message     startup
  15.     message     entered
  16.     message     exited
  17.     message     activated
  18.     
  19.     thing       player      local
  20.     thing       candle
  21.     thing       cam_Left
  22.     thing       cam_Right
  23.     thing       camPos
  24.     
  25.     thing       spider0
  26.     thing       spider1
  27.     
  28.     surface     surf_Left0      linkID=1
  29.     surface     surf_Left1      linkID=1
  30.     surface     surf_Left2      linkID=1
  31.     surface     surf_Left3      linkID=1
  32.     surface     surf_Right0     linkID=2
  33.     surface     surf_Right1     linkID=2
  34.     surface     surf_Right2     linkID=2
  35.     surface     surf_Right3     linkID=2
  36.     
  37.     sound        foundSnd1=inxj173.wav    local
  38.     sound        foundSnd2=rv04j02.wav    local
  39.     
  40.     cog         talkCog             local
  41.     
  42.     int         gotIt=0             local
  43.     int         lSpot=0             local
  44.     int         rSpot=0             local
  45.     int         curCam              local
  46.     
  47. end
  48.  
  49. # ========================================================================================
  50.  
  51. code
  52.  
  53. startup:
  54.  
  55.     player = GetLocalPlayerThing();
  56.     
  57.     SetActorFlags(spider0, 0x400);  # deaf
  58.     SetActorFlags(spider1, 0x400);
  59.     SetActorFlags(spider0, 0x800);  # blind
  60.     SetActorFlags(spider1, 0x800);
  61.     return;
  62.     
  63. # ========================================================================================
  64.  
  65. entered:
  66.  
  67.     if(GetSenderID() == 1) lSpot = 1;
  68.     if(GetSenderID() == 2) rSpot = 1;
  69.  
  70.     return;
  71.     
  72. # ========================================================================================
  73.  
  74. exited:
  75.  
  76.     if((GetSenderID() == 1) && (GetSourceRef() == player)) lSpot = 0;
  77.     if((GetSenderID() == 2) && (GetSourceRef() == player)) rSpot = 0;
  78.  
  79.     return;
  80.     
  81. # ========================================================================================
  82.  
  83. activated:
  84.  
  85.     if((GetSenderRef() == candle) && (gotIt == 0))
  86.     {
  87.         gotIt = 1;
  88.         curCam = GetCurrentCamera();
  89.         
  90.         ClearActorFlags(spider0, 0x400);
  91.         ClearActorFlags(spider1, 0x400);
  92.         ClearActorFlags(spider0, 0x800);
  93.         ClearActorFlags(spider1, 0x800);
  94.     
  95.         # sends message to spider_wall's class cog, saying "user0" (27)
  96.         SendMessageEx(GetThingClassCog(spider0), 27, spider0, 0, 0, 0);
  97.         SendMessageEx(GetThingClassCog(spider1), 27, spider1, 0, 0, 0);
  98.     
  99.         # do cutscene stuff
  100.         StartCutscene(1);
  101.         StopThing(player);
  102.         MakeMeStop();
  103.         
  104.         if(lSpot == 1) SetCameraFocus(2, cam_Right);
  105.         else if(rSpot == 1) SetCameraFocus(2, cam_Left);
  106.         SetCameraSecondaryFocus(2, player);
  107.         SetCurrentCamera(2);
  108.         SetCameraFOV(90, 0, 0.0);
  109.         
  110.         # put away any weapon
  111.         DeselectWeaponWait(player);
  112.         
  113.         # pickup the candle
  114.         PlayMode(player, 60, 0);
  115.         Sleep(0.3);
  116.         DestroyThing(candle);
  117.         
  118.         # Call the Pickup Lines cog
  119.         talkCog = GetCogByIndex(0);
  120.         SendMessage(talkCog, 27);
  121.         
  122.         # sleep to wait for talkCog
  123.         Sleep(1.3);
  124.         
  125.         # add oilCan to inventory
  126.         SetInvAvailable(player, 91, 1);
  127.         ChangeInv(player, 91, 1.0);
  128.         JonesInvItemChanged(91);
  129.         
  130.         if (!global10)
  131.         {
  132.             PlayVoice(player, foundSnd1, 1.0, 1);
  133.             global10 = 1;
  134.         }
  135.         else
  136.         {
  137.             PlayVoice(player, foundSnd2, 1.0, 1);
  138.         }
  139.     
  140.         # return camera to player
  141.         SetCameraPosition(curCam, GetThingPos(camPos));
  142.         SetCurrentCamera(curCam);
  143.         
  144.         # restore controls
  145.         ClearActorFlags(player, 0x200000);
  146.         EndCutscene();
  147.     }
  148.  
  149.     return;
  150.             
  151. # ========================================================================================
  152.         
  153. end
  154.  
  155.